﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ManageMenu.ascx.cs"
    Inherits="NLLSite.Administrator.UserControl.ManageMenu" %>
<style type="text/css">
    .style2
    {
        width: 208px;
        vertical-align:middle;
    }
    .style1
    {
        width: 261px;
    }
</style>
<div class="box box-100">
    <div class="boxin">
        <div class="header">
            <h3>
                Quản lý Menu</h3>
        </div>
        <div style="padding: 18px;">
            <!--<form class="basic" action="" method="post" enctype="multipart/form-data"><!-- Default basic forms -->
            <div class="inner-form">
                <table>
                    <tr>
                        <td>
                            <asp:Panel ID="Panel1" runat="server">
                                <table>
                                    <tr>
                                        <td class="style2">
                                            Tên Menu :
                                        </td>
                                        <td class="style1">
                                            <asp:TextBox ID="TxtMenu" runat="server" Width="250px"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtMenu"
                                                ErrorMessage="*"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            Vị Trí :
                                        </td>
                                        <td class="style1">
                                            <asp:DropDownList ID="Ddlposi" runat="server" Width="256px" AutoPostBack="True" 
                                                onselectedindexchanged="Ddlposi_SelectedIndexChanged">
                                                <asp:ListItem>Top</asp:ListItem>
                                                <asp:ListItem Value="Chủ Đề">Chủ Đề</asp:ListItem>
                                                <asp:ListItem Value="Hội Thảo">Hội Thảo</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            Chọn Menu Cha :
                                        </td>
                                        <td class="style1">
                                            <asp:ListBox ID="LbxMenuid" runat="server" DataTextField="Name"
                                                DataValueField="ID" Width="200px">
                                            </asp:ListBox>
                                            <asp:LinqDataSource ID="LinqDataSource3" runat="server" 
                                                ContextTypeName="DAL_Class.NLLDataContext" Select="new (ID, Name)" 
                                                TableName="Menus" Where="Position == @Position">
                                                <WhereParameters>
                                                    <asp:Parameter DefaultValue="Chủ Đề" Name="Position" Type="String" />
                                                </WhereParameters>
                                            </asp:LinqDataSource>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            Số Thứ Tự
                                        </td>
                                        <td class="style1">
                                            <asp:TextBox ID="TxtSortNo" runat="server" Width="250px"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                                ErrorMessage="Nhập Số" ControlToValidate="TxtSortNo" Display="Dynamic" 
                                                ValidationExpression="^[0-9][0-9]*$"></asp:RegularExpressionValidator>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="TxtSortNo"
                                                ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            Meta Title :
                                        </td>
                                        <td class="style1">
                                            <asp:TextBox ID="TxtMetatit" runat="server" Width="250px"></asp:TextBox>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            Meta Description :
                                        </td>
                                        <td class="style1">
                                            <asp:TextBox ID="TxtMetades" runat="server" Width="250px"></asp:TextBox>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            Meta Keys :
                                        </td>
                                        <td class="style1">
                                            <asp:TextBox ID="TxtMetakey" runat="server" Width="250px"></asp:TextBox>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            Meta Robot :
                                        </td>
                                        <td class="style1">
                                            <asp:TextBox ID="TxtMetaTo" runat="server" Width="250px"></asp:TextBox>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            Meta Author :
                                        </td>
                                        <td class="style1">
                                            <asp:TextBox ID="TxtMetaaut" runat="server" Width="250px"></asp:TextBox>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            Trạng Thái :</td>
                                        <td class="style1">
                                            <asp:CheckBox ID="CbcStatu" runat="server" Text="Hiện" />
                                        </td>
                                        <td>
                                            &nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            &nbsp;
                                        </td>
                                        <td class="style1">
                                            <asp:Label ID="LblCheck" runat="server"></asp:Label>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            &nbsp;
                                        </td>
                                        <td class="style1">
                                            <asp:Button ID="BtnAdd" runat="server" Text="Cập Nhật" OnClick="BtnAdd_Click"
                                                CssClass="altbutton" />
                                            &nbsp;
                                            <asp:Button ID="Button2" runat="server" Text="Thiết Lập Lại" OnClick="Button2_Click"
                                                CssClass="altbutton" />
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Panel ID="Panel2" runat="server">
                                <br />
                                <asp:CheckBox ID="CbxDele" runat="server" 
                                    OnCheckedChanged="CbxDele_CheckedChanged" AutoPostBack="True" />
                                &nbsp;
                                <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Xóa" OnClientClick="javascript:return confirm('Bạn có muốn xóa?')"
                                    CssClass="altbutton" />
                                &nbsp;
                                <asp:Button ID="Button4" runat="server" onclick="Button4_Click" 
                                    Text="Thêm Mới" />
                                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                    CellPadding="4" DataKeyNames="ID" DataSourceID="LinqDataSource2" EnableModelValidation="True"
                                    GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
                                    Width="920px" AllowSorting="True" ForeColor="#333333">
                                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                    <Columns>
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="Cbx" runat="server" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                                            SortExpression="ID" Visible="False" />
                                        <asp:BoundField DataField="Name" HeaderText="Tên Menu" SortExpression="Name">
                                            <HeaderStyle HorizontalAlign="Left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Name2" HeaderText="Menu Cha" SortExpression="Name2">
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Position" HeaderText="Vị Trí" 
                                            SortExpression="Position" HtmlEncode="False" HtmlEncodeFormatString="False">
                                            <HeaderStyle HorizontalAlign="Left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="SortNumber" HeaderText="Thứ tự Sắp Xếp" SortExpression="SortNumber">
                                            <HeaderStyle HorizontalAlign="Left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </asp:BoundField>
                                        <asp:CheckBoxField DataField="Status" HeaderText="Trạng Thái" SortExpression="Status">
                                            <HeaderStyle HorizontalAlign="Left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </asp:CheckBoxField>
                                        <asp:BoundField DataField="MetaTitle" HeaderText="MetaTitle" SortExpression="MetaTitle">
                                            <HeaderStyle HorizontalAlign="Left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </asp:BoundField>
                                        <asp:CommandField ShowSelectButton="True" SelectText="Xem" />
                                        <asp:TemplateField HeaderText="Metades" Visible="False">
                                            <ItemTemplate>
                                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("MetaDescription") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="MetaKey" Visible="False">
                                            <ItemTemplate>
                                                <asp:Label ID="Label2" runat="server" Text='<%# Eval("MetaKeywords") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="MetaRo" Visible="False">
                                            <ItemTemplate>
                                                <asp:Label ID="Label3" runat="server" Text='<%# Eval("MetaRobots") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Metaaut" Visible="False">
                                            <ItemTemplate>
                                                <asp:Label ID="Label4" runat="server" Text='<%# Eval("MetaAuthor") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <EditRowStyle BackColor="#999999" />
                                    <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
                                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                </asp:GridView>
                                <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
                                    ContextTypeName="DAL_Class.NLLDataContext" TableName="View_Menu_ALLs">
                                </asp:LinqDataSource>
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>
